<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
	protected function _initDoctype()
	{
		Zend_Layout::startMvc();
		$this->bootstrap('view');
		$view = $this->getResource('view');
		$view->headTitle('Ma premiere application avec Zend');
		$view->doctype('XHTML1_STRICT');
		$view->headScript()->appendFile('http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');
		$view->headLink()->prependStylesheet('bootstrap/css/bootstrap.css');
		$view->headScript()->appendFile('bootstrap/js/bootstrap.js');
		$view->headScript()->appendScript("$(function (){ $('a').tooltip(); }); ");
		
	}
	protected function _initRouter()
	{
		// Récupère l'instance courante du router actuel si il existe sinon en créer un
		$router = Zend_Controller_Front::getInstance()->getRouter();
		
 
		// Défini la route 'article'
		$route = new Zend_Controller_Router_Route_Regex('comment/id-(\d+)\.html?', array(
					'controller'	=> 'comment',
					'action'	=> 'index'
				), array(
					1	=> 'comment_id'
				), 'comment/id-%s.html');
		
 
    	// Ajoute la route au router et renvoi l'objet
    	$router->addRoute('comment', $route);
    	return $router;
	}
	
	protected function _initMails()
	{
		$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', 'mail');
		$mailConfig = $config->toArray();
	
		Zend_Registry::set('Mail_Config', $mailConfig['mail']['config']);
	}
	
	


}

